<!-- include tpl=head_lay -->
<form method="post" class="layui-form" id="post_save" onsubmit="return $.admin_all.system(this);">

<div class="layui-card">
	<div class="layui-card-header">
		{lang系统参数设置}
	</div>
	<div class="layui-card-body">
		<blockquote class="layui-elem-quote">
			<p>RSA证书模式采用两套证书交叉使用，在APP里配置【服务端公钥 public_key】和【客户端私钥 private_key 】用于解决数据加密及解密传输</p>
			<p>API验证串适合在WEB里互传或用于存储Cookie进行加密或用于生成Token防止CRSF</p>
		</blockquote>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{langAPI验证串}
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="api_code" name="api_code" value="{$rs.api_code}" placeholder="" autocomplete="off" class="layui-input">
			</div>
			<div class="layui-input-inline auto gray lh38">
				<div class="layui-btn-group">
					<input type="button" value="{lang随机生成}" onclick="$.admin_all.rand()" class="layui-btn layui-btn-sm" />
					<input type="button" value="删除" onclick="$('#api_code').val('')" class="layui-btn layui-btn-sm layui-btn-danger" />
				</div>
			</div>
			<div class="layui-form-mid">
				{lang用于数据加密通迅时使用，建议设置复杂}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang服务端公钥}<br />
				<input type="button" value="{lang生成}" onclick="$.admin_all.rsa_create()" class="layui-btn layui-btn-xs" />
			</label>
			<div class="layui-input-block gray">
				{lang对应APP或小程序里的 publick_key，用于加密要传输的数据}
			</div>
			<div class="layui-input-block">
				<textarea name="public_key" id="public_key" class="layui-textarea">{$rs.public_key}</textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang服务端私钥}
			</label>
			<div class="layui-input-block gray">{lang放在服务端里，用于解密客户端发过来的数据}</div>
			<div class="layui-input-block">
				<textarea name="private_key" id="private_key" class="layui-textarea">{$rs.private_key}</textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang客户端公钥}<br />
				<input type="button" value="{lang生成}" onclick="$.admin_all.rsa_create2()" class="layui-btn layui-btn-xs" />
			</label>
			<div class="layui-input-block gray">
				{lang放在服务端里，用于加密要发送给客户端的数据}
			</div>
			<div class="layui-input-block">
				<textarea name="public_key2" id="public_key2" class="layui-textarea">{$rs.public_key2}</textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang客户端私钥}
			</label>
			<div class="layui-input-block gray">{lang对应APP或小程序里的 private_key，用于解密要服务端发过来的数据}</div>
			<div class="layui-input-block">
				<textarea name="private_key2" id="private_key2" class="layui-textarea">{$rs.private_key2}</textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				默认模式
			</label>
			<div class="layui-input-block">
				<input type="radio" name="chktype" value="code" title="API验证串" lay-skin="primary"{if $rs.chktype == 'code'} checked{/if} />
				<input type="radio" name="chktype" value="rsa" title="RSA证书" lay-skin="primary"{if $rs.chktype == 'rsa'} checked{/if} />
			</div>
		</div>
	</div>
</div>

<div class="layui-card">
	<div class="layui-card-header">
		OK 官网接口参数
	</div>
	<div class="layui-card-body">
		<div class="layui-form-item">
			<label class="layui-form-label">
				状态
			</label>
			<div class="layui-input-block">
				<input type="radio" name="ok_status" value="1" title="启用" lay-skin="primary"{if $rs.ok_status} checked{/if} />
				<input type="radio" name="ok_status" value="0" title="禁用" lay-skin="primary"{if !$rs.ok_status} checked{/if} />
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				APPID
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" name="ok_appid" id="ok_appid" value="{$rs.ok_appid}" class="layui-input" />
			</div>
			<div class="layui-form-mid">
				填写官方的APPID，不清楚可以点【<a href="//www.phpok.com/?id=24920" target="_blank" title="">这里查看，仅限官网已登录会员</a>】
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				APPKey
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" name="ok_appkey" id="ok_appkey" value="{$rs.ok_appkey}" class="layui-input" />
			</div>
			<div class="layui-form-mid">
				同上
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				<div style="margin-top:15px">域名</div>
			</label>
			<div class="layui-input-block">
				<div class="layui-tab layui-tab-brief">
					<ul class="layui-tab-title">
						<li class="layui-this">IP转城市</li>
						<li>翻译API</li>
					</ul>
					<div class="layui-tab-content">
						<div class="layui-tab-item layui-show">
							<input type="text" name="links[ip2city]" value="{$links.ip2city}" placeholder="IP转城市" title="IP转城市" class="layui-input" />
						</div>
						<div class="layui-tab-item">
							<input type="text" name="links[translate]" value="{$links.translate}" placeholder="翻译API" title="翻译API" class="layui-input" />
						</div>
					</div>
				</div>
			</div>
			<div class="layui-input-block mtop">请填写完整的接口地址，如 https://域名/apix-24920</div>
		</div>
	</div>
</div>

<div class="layui-card">
	<div class="layui-card-header">
		后台布局
	</div>
	<div class="layui-card-body">
		<div class="layui-form-item">
			<label class="layui-form-label">
				显示项
			</label>
			<div class="layui-input-block">
				<input type="checkbox" name="admin_homepage_setting[]" value="content" title="内容统计" lay-skin="primary"{if in_array('content',$rs.admin_homepage_setting)} checked{/if} />
				<input type="checkbox" name="admin_homepage_setting[]" value="safecheck" title="安全检查" lay-skin="primary"{if in_array('safecheck',$rs.admin_homepage_setting)} checked{/if} />
				<input type="checkbox" name="admin_homepage_setting[]" value="env" title="主机环境" lay-skin="primary"{if in_array('env',$rs.admin_homepage_setting)} checked{/if} />
			</div>
		</div>
	</div>
</div>

<div class="submit-info-clear"></div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang保存设置}" class="layui-btn layui-btn-danger" id="save_button" />
	</div>
</div>
</form>
<!-- include tpl=foot_lay -->